#include "dkglDrawList.h"
#include "dkglDrawable.h"

namespace DKGL
{
    DrawList::DrawList()
    {

    }

        
    DrawList::~DrawList()
    {

    }

        
    void DrawList::add(Drawable* drawable)
    {
        _drawList.push_back(drawable);
    }

        
    void DrawList::flush()
    {
        std::list<Drawable*>::iterator iter(_drawList.begin());
        std::list<Drawable*>::iterator end(_drawList.end());

        for (;iter!=end;++iter)
        {
            (*iter)->renderImpl();
        }

        _drawList.clear();
    }
    
}